﻿/*----------------------------------------------------------------
// Copyright (C) 2016 通通优品版权所有。
// 命名空间: STOWaybillMall.Products
// 类名：ProductAppService
// 功能描述：N/A
// 
// 创建标识：Roc.Lee(李鹏鹏) 2017/8/24 17:28:56 TEC-ROCLEE Roc.Lee

// 修改标识：
// 修改描述：
// 
//
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using STOWaybillMall.Products.Dto;
using STOWaybillMall.IRepositories;
using Abp.AutoMapper;
using static STOWaybillMall.Products.Dto.GetProductListOutput;
using Abp.Domain.Uow;

namespace STOWaybillMall.Products
{
    public class ProductAppService : STOWaybillMallAppServiceBase, IProductAppService
    {
        private readonly IProductInfoRepository _IProductInfoRepository;
        public ProductAppService(IProductInfoRepository _IProductInfoRepository)
        {
            this._IProductInfoRepository = _IProductInfoRepository;
        }

        public GetProductDetailOutput GetProductDetail(GetProductDetailInput input)
        {
            throw new NotImplementedException();
        }
        [UnitOfWork(isTransactional: false)]
        public GetProductListOutput GetProductList(GetProductListInput input)
        {
            var model =  _IProductInfoRepository.GetProductList();

            return new GetProductListOutput()
            {
                Products = model.MapTo<IList<ProductListInfo>>()
            };
        }
    }
}
